package com.st.ssdr.rabbitmq.lister;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.core.ChannelAwareMessageListener;
import org.springframework.stereotype.Component;

import com.rabbitmq.client.Channel;


@Component
public class ActivityListener1 implements ChannelAwareMessageListener {
    
    
    private static final  Logger log =  LoggerFactory.getLogger(ActivityListener.class);


    @Override
    public void onMessage(Message message, Channel channel) throws Exception {
       System.out.println("{reve}接收到的消息" + message);
       //响应失败
       //channel.basicNack(message.getMessageProperties().getDeliveryTag(), false, false);
       //响应成功
       channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
    }
}
